const mysql = require('mysql2/promise');

async function dropDatabase() {
    const connection = await mysql.createConnection({
        host: 'localhost',
        user: 'root',
        password: '123456'
    });

    try {
        // 删除数据库
        await connection.query('DROP DATABASE IF EXISTS cloud_drive');
        console.log('数据库删除成功！');
    } catch (error) {
        console.error('删除数据库失败：', error);
    } finally {
        await connection.end();
    }
}

dropDatabase();